package cn.edu.hit.core.db;

import cn.edu.hit.core.Document;

import java.util.List;

public class DBReadHelper {
    private final DataReader reader;

    public DBReadHelper(DataReader reader) {
        this.reader = reader;
    }

    public List<Document> loadConfigure(String name, String type) {
        return reader.queryByTemplate(
                Filters.and(
                        Filters.eq("name", name),
                        Filters.eq("type", type)));
    }

    public Document getById(String _id) {
        return reader.getById(_id);
    }
}
